<include file="public@head" />
</head>

<body>
    <div class="layui-fluid wrap" id="component-tabs">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">友情链接</div>
                    <div class="layui-card-body">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li><a href="{:url('link/index')}">{:lang('ADMIN_LINK_INDEX')}</a></li>
                                <li><a href="{:url('link/add')}">{:lang('ADMIN_LINK_ADD')}</a></li>
                                <li class="layui-this"><a>编辑友情链接</a></li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <form method="post" class="layui-form js-ajax-form" action="{:url('link/editPost')}">
                                        <div class="layui-form-item">
                                            <label for="input-name" class="layui-form-label">名称<span style="color:#FF5722;">*</span></label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-name" name="name" value="{$link.name}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-url" class="layui-form-label">链接地址<span style="color:#FF5722;">*</span></label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-url" name="url" value="{$link.url}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-image" class="layui-form-label">图标</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-image" name="image" value="{$link.image}">
                                                <a class="layui-btn layui-btn-sm" style="margin-top:8px;" href="javascript:uploadOneImage('图片上传','#input-image');">上传图片</a>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-target" class="layui-form-label">打开方式</label>
                                            <div class="layui-input-block">
                                                <select name="target" id="input-target">
                                                    <foreach name="targets" item="vo">
                                                        <php>$link_target_selected=$link['target']==$key?"selected='selected'":"";</php>
                                                        <option value="{$key}" {$link_target_selected}>{$vo}</option>
                                                    </foreach>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-description" class="layui-form-label">描述</label>
                                            <div class="layui-input-block">
                                                <textarea class="layui-textarea" name="description" id="input-description">{$link.description}</textarea>
                                            </div>
                                        </div>
                                        <div class="layui-form-item layui-layout-admin">
                                            <div class="layui-input-block">
                                                <div class="layui-footer" style="left:0;">
                                                    <input type="hidden" name="id" value="{$link.id}">
                                                    <button type="submit" class="layui-btn js-ajax-submit">{:lang('ADD')}</button>
                                                    <a class="layui-btn layui-btn-primary" href="{:url('link/index')}">{:lang('BACK')}</a>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="public@footer" />
</body>

</html>